require(['farm-footer','loading'], function(farmfooter,loading) {
	var salesIndex = new Vue({
		el: '#salesIndex',
		data: {
			showLoading: false,
			apiUrl: wxUrl + '/v3.3/settlement/indexStatistics',
			numsUrl: wxUrl + '/v3.3/pforder/orderStatusNum',
			item: {
				params:{
					token: token,
					userToken: userToken
				}
			},
			numsItem: {
				params:{
					token: token,
					userToken: userToken
				}
			}
		},
		ready: function() {
			/*this.getIndexData();
			this.getNum();*/
	    },
		methods: {
			getIndexData: function() {
				this.item.params.token = token;
				this.$http.get(this.apiUrl, this.item)
					.then(function(response) {
						var result = JSON.parse(response.body);
						var sales = result.data;
						this.$set('sales', sales);
					},function(response) {
						//errorCallback
					});
			},
			getNum: function() {
				this.numsItem.params.token = token;
				this.$http.get(this.numsUrl, this.numsItem)
					.then(function(response) {
						var result = JSON.parse(response.body);
						var nums = result.data;
						this.$set('nums', nums);
					},function(response) {
						//errorCallback
					});
			}
		}
	});
	
	setTimeout(function(){
		salesIndex.getIndexData();
		salesIndex.getNum();
	},500);
});